﻿<?php
session_start();
require_once '../bin/Common/Message.class.php';
$user = md5($_POST["username"]);
$pass = md5($_POST["password"]);
$dom = new DOMDocument();
if (!$dom->load('xml/4cjdx7.xml'))
{
echo "load xml failed!<br>";
}

$domuser = $dom->getElementsByTagName('user');
$username = $domuser->item(0)->getAttribute('value');

$dompass = $dom->getElementsByTagName('pass');
$passname = $dompass->item(0)->getAttribute('value');

/*foreach ($bars as $bar)
{
$arr[] = $bar->getAttribute('attr');
}
*/

if ($user != $username)
{
	Message::show("用户名错误","-1");
}
if ($pass != $passname)
{
	Message::show("密码错误","-1");
}
$_session['user_guid']=md5(rand(0,100));
header("Location:index.php");
//echo $_session['user_guid'];
?>